﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XrmLibrary.Pooling
{
    public class ServicePool<T> : ObjectPool<T>, IDisposable where T : IDisposable
    {
        public ServicePool(Func<T> objectGenerator)
            : base(objectGenerator)
        { }

        public void Dispose()
        {
            foreach (T obj in GetAllObjects())
            {
                obj.Dispose();
            }
        }
    }
}
